package com.zhaowb.springcloud.admin.mapper;

import com.zhaowb.springcloud.admin.entity.Group;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

/**
 * Created with IDEA
 *
 * @author zhaowb
 * @date 2018/11/1 10:17
 */
@Repository
public interface GroupMapper extends Mapper<Group> {

    /**
     * 根据分组id删除分组成员
     *
     * @param groupId 分组id
     */
    void deleteGroupMembersById(@Param("groupId") int groupId);

    /**
     * 根据分组id删除分组leader
     *
     * @param groupId 分组id
     */
    void deleteGroupLeadersById(@Param("groupId") int groupId);

    /**
     * 插入分组member
     *
     * @param groupId 分组id
     * @param userId  用户id
     */
    void insertGroupMembersById(@Param("groupId") int groupId, @Param("userId") int userId);

    /**
     * 插入分组leader
     *
     * @param groupId 分组id
     * @param userId  用户id
     */
    void insertGroupLeadersById(@Param("groupId") int groupId, @Param("userId") int userId);
}